package main

import (
	"bufio"
	"fmt"
	"os"
)

func main(){
    os.Create("demo.txt")
    f,err:=os.OpenFile("demo.txt",os.O_WRONLY,os.ModeAppend)
    if err != nil{
        fmt.Println(err)
        return
    }
    defer f.Close()
    writer:=bufio.NewWriter(f)
    writer.WriteString("Hello World!")
    writer.Flush()
}